<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue 实例生命周期函数</title>
    <script charset="UTF-8" src="js/vue.js"></script>
</head>
<body>
    <div id="app"></div>
<script>
    let vm = new Vue({
        el:'#app',
        template:'<div>{{text}}</div>',
        data:{
          text:'hell world'
        },
        beforeCreate:function () {
            console.log("beforeCreate");
        },
        created:function () {
            console.log("create");
        },
        beforeMount:function () {
            console.log(this.$el);
            console.log("beforeMount");
        },
        mounted:function () {
            console.log(this.$el);
            console.log("mounted");
        },
        beforeDestroy:function () {
            console.log("beforeDestroy");
        },
        destroyed:function () {
            console.log("destroyed");
        },
        beforeUpdate:function () {
            console.log("beforeUpdate");
        },
        updated:function () {
            console.log("updated");
        }
    });
</script>
</body>
</html>